#!/bin/sh

echo ">>> Killing php-fpm"
/bin/pkill -F /var/run/php-fpm.pid 
sleep 2

# Run the php.ini setup file and populate
# /usr/local/etc/php.ini and /usr/local/lib/php.ini
/etc/rc.conf_mount_rw
/etc/rc.php_ini_setup 2>/tmp/php_errors.txt
/etc/rc.conf_mount_ro
echo ">>> Restarting php-fpm" | /usr/bin/logger -p daemon.info -i -t rc.php-fpm_restart
echo ">>> Starting php-fpm"
/usr/local/sbin/php-fpm -c /usr/local/lib/php.ini -y /usr/local/lib/php-fpm.conf -RD 2>&1 >/dev/null

